package com.ruoyi.quartz.task;

import com.ruoyi.quartz.service.IAppRankService;
import com.ruoyi.quartz.service.ISynchronousLotteryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.util.ObjectUtils;

@Component("rankTask")
public class RankTask {

    @Autowired
    private IAppRankService rankService;

    @Autowired
    private ISynchronousLotteryService lotteryService;

    /**
     * 获取用户排行榜
     */
    public void getUserRank() {
        rankService.getUserRank();
    }

    /**
     * 获取部门排行榜
     */
    public void getDeptRank() {
        rankService.getDeptRank();
    }

    /**
     * 获取队伍排行榜
     */
    public void getTeamRank() {
        rankService.getTeamRank();
    }


    /**
     * 同步中奖人数
     */
    public void synchronousLotteryData(){
        lotteryService.syncLotteryWinNum();

    }

    /**
     * 同步用户数据
     */
    public void syncLotteryUserData(Long id){
        if (ObjectUtils.isEmpty(id))
            id = 25050L;
        lotteryService.syncLotteryLotteryData(id);
    }



    public void getUserPrePrize() {

    }

}
